

const Currency = {
  //api关键字
  tableTitle: "货币管理",
  apiKey: "Currency",
  archetype: [
    { key: "id", name: "ID", editHidden: true, columnHidden: true, },
    { key: "name", name: "货币名称", inputType: "text", inputAttrs: { maxlength: 15 } },
    { key: "code", name: "货币代号", inputType: "text", inputAttrs: { maxlength: 15 } },
  ],
  formRules: {
    name: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
    code: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
  },
}
// const Agent = {
//   tableTitle: "代理管理",
//   apiKey: "Agent",
//   operation: { EDIT: true, DELETE: true },
//   archetype: [
//     { key: "id", name: "ID", editHidden: true, },
//     { key: "name", name: "代理商名称", inputType: "text", inputAttrs: { maxlength: 15 } },
//     { key: "contact", name: "姓名", inputType: "text", inputAttrs: { maxlength: 15 } },
//     { key: "mobile", name: "电话", inputType: "text", inputAttrs: { maxlength: 25 } },
//     { key: "address", name: "地址", inputType: "text", inputAttrs: { type: "textarea", maxlength: 100 } },
//   ],
//   formRules: {
//     name: [
//       { required: true, message: '参数不能为空', trigger: 'blur' },
//       { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
//     ],
//     contact: [
//       { required: true, message: '参数不能为空', trigger: 'blur' },
//       { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
//     ],
//     mobile: [
//       { required: true, message: '参数不能为空', trigger: 'blur' },
//       { max: 25, message: '长度最多 25 个字符', trigger: 'blur' }
//     ],
//     address: [
//       { required: true, message: '参数不能为空', trigger: 'blur' },
//       { max: 100, message: '长度最多 100 个字符', trigger: 'blur' }
//     ],
//   }
// }
const Nation = {
  tableTitle: "国家管理",
  apiKey: "Nation",
  classifyPage: true,
  searchOption: [
    { key: "name", name: "国家名称", type: "text", },
    { key: "code", name: "国家代号", type: "text", },
  ],
  archetype: [
    { key: "id", name: "ID", editHidden: true, columnHidden: true, },
    { key: "name", name: "国家名称", inputType: "text", inputAttrs: { maxlength: 15 } },
    { key: "code", name: "国家代号", inputType: "text", inputAttrs: { maxlength: 15 } },
  ],
  formRules: {
    name: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
    code: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
  }
}

const Repository = {
  tableTitle: "仓库管理",
  apiKey: "Repository",
  classifyPage: true,
  operation: { EDIT: true, DELETE: true },
  searchOption: [
    { key: "name", name: "仓库名称", type: "text", },
  ],
  archetype: [
    { key: "id", name: "ID", editHidden: true, columnHidden: true, },
    { key: "name", name: "仓库名称", inputType: "text", inputAttrs: { maxlength: 20 } },
    { key: "recivername", name: "联系人", inputType: "text", inputAttrs: { maxlength: 15 } },
    { key: "recivermobil", name: "联系电话", inputType: "text", inputAttrs: { maxlength: 25 } },
    { key: "region", name: "地区", inputType: "text", inputAttrs: { maxlength: 30 } },
    { key: "address", name: "地址", inputType: "text", inputAttrs: { type: "textarea", maxlength: 100 } },
    { key: "foreignrecivername", name: "英语联系人", inputType: "text", inputAttrs: { maxlength: 15 } },
    { key: "foreignrecivermobil", name: "英语联系电话", inputType: "text", inputAttrs: { maxlength: 25 } },
    { key: "foreignregion", name: "英语地区", inputType: "text", inputAttrs: { maxlength: 30 } },
    { key: "foreignaddress", name: "英语地址", inputType: "text", inputAttrs: { type: "textarea", maxlength: 100 } },
  ],
  formRules: {
    name: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
    ],
    recivername: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
    recivermobil: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { max: 25, message: '长度最多 25 个字符', trigger: 'blur' }
    ],
    region: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { max: 30, message: '长度最多 30 个字符', trigger: 'blur' }
    ],
    address: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { max: 100, message: '长度最多 100 个字符', trigger: 'blur' }
    ],
    foreignrecivername: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
    foreignrecivermobil: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { max: 25, message: '长度最多 25 个字符', trigger: 'blur' }
    ],
    foreignregion: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { max: 30, message: '长度最多 30 个字符', trigger: 'blur' }
    ],
    foreignaddress: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { max: 100, message: '长度最多 100 个字符', trigger: 'blur' }
    ],
  }
}
const Courier = {
  tableTitle: "快递管理",
  apiKey: "Courier",
  classifyPage: true,
  operation: { EDIT: true, DELETE: true },
  searchOption: [
    { key: "name", name: "快递名称", inputType: "text", },
    { key: "type", name: "快递类型", inputType: "select", inputOptions: [{ label: '国际', value: 1 }, { label: '国内', value: 2 }] },

  ],
  archetype: [
    { key: "id", name: "ID", editHidden: true, columnHidden: true, },
    { key: "name", name: "快递名称", inputType: "text", inputAttrs: { maxlength: 20 } },
    { key: "code", name: "代号", inputType: "text", inputAttrs: { maxlength: 15 } },
    { key: "extname", name: "简称", inputType: "text", inputAttrs: { maxlength: 15 } },
    {
      key: "type", name: "快递类型", default: 1, columnAttrs: { formatter: (r, c, v, i) => { return v == 0 ? '通用' : v == 1 ? '国际' : '国内' } },
      inputType: "select", inputAttrs: {}, inputOptions: [{ label: '国际', value: 1 }, { label: '国内', value: 2 }]
    },
    { key: "order", name: "快递排序", default: 0, inputType: "number", inputAttrs: { min: 0 } },
    { key: "addtime", name: "添加时间", editHidden: true, },
  ],
  formRules: {
    name: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
    ],
    code: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
    extname: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
    ],
  },
}
const SystemSetting = {
  tableTitle: "系统设置",
  apiKey: "SystemSetting",
  classifyPage: true,
  operation: { EDIT: true, DELETE: false },
  searchOption: [
    { key: "name", name: "名称", inputType: "text", },
    { key: "code", name: "代码", inputType: "text", },
  ],
  archetype: [
    { key: "id", name: "ID", editHidden: true, columnHidden: true, },
    { key: "name", name: "名称", inputType: "text", inputAttrs: { maxlength: 20 } },
    { key: "code", name: "代码", inputType: "text", inputAttrs: { maxlength: 20 } },
    { key: "value", name: "数值", inputType: "text", inputAttrs: { maxlength: 20 } },
  ],
  formRules: {
    name: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
    ],
    code: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
    ],
    value: [
      { required: true, message: '参数不能为空', trigger: 'blur' },
      { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
    ],
  },
}

export default { Currency, Nation, Repository, Courier, SystemSetting }